<%
'-------------------  Validate date as YYYYMMDD ---------------------------------

Public Function ValidateDate(ByVal strDate, ByVal DateType)


Dim strYear
Dim strMonth
Dim strDay
Dim strErrMsg

strErrMsg = ""


If Len(strDate) < 8 Then
    strErrMsg = "Please enter the " & DateType & " date in the format YYYYMMDD."
else
	strYear = Left(strDate, 4)
	strMonth = Mid(strDate,5,2)
	strDay = Right(strDate,2)
	
	If Not (cstr(strYear) >= "19")  Then
	    strErrMsg = "Please enter the " & DateType & " date in the format YYYYMMDD."
	ElseIf cstr(strMonth) > "12" Then
		strErrMsg = "Please enter the " & DateType & " date in the format YYYYMMDD."
	ElseIf cstr(strDay) > "31" Then
		strErrMsg = "Please enter the " & DateType & " date in the format YYYYMMDD."
	End If
end if

ValidateDate = strErrMsg

End Function 'ValidateAccrualDate
%>		